﻿#include "global.h"

QString gate_url_prefix = nullptr;

std::function<void(QWidget*)> repolish = [](QWidget* w) {
    w->style()->unpolish(w);
    w->style()->polish(w);
};

std::function<QString(QString)> xorString = [](QString input) {
    QString result = input;
    int length = input.length();
    // 防止字符长度过长，进行取模，便于后续的处理
    int len = length % 255;
    for (int i = 0; i < length; ++ i) {
        // 对每一个字符进行异或
        result[i] = QChar(static_cast<ushort>(input[i].unicode() ^ static_cast<ushort>(len)));
    }

    return result;
};
